
static char RCSId[]="$Id: ContourOptionsPanel.m,v 1.1.1.1 1993/03/18 03:31:29 davis Exp $";



#import <appkit/Application.h>
#import <appkit/Button.h>
#import <appkit/Matrix.h>
#import <appkit/Panel.h>
#import <appkit/TextField.h>

#import "ContourOptionsPanel.h"
#import "Status.h"
#import "StatusContour.h"


@interface ContourOptionsPanel (Private)

- _updatePanel;			/** Overridden from OptionsPanel (Private) **/

@end



@implementation ContourOptionsPanel

- init
{
    [super init];

    [NXApp loadNibSection: "ContourOptionsPanel.nib"
		    owner: self
		withNames: NO
		 fromZone: [self zone]];

    [panel setFrameUsingName:"ContourOptionsPanel"];
    [panel setFrameAutosaveName:"ContourOptionsPanel"];

    return self;
}


- doSetKind:sender
{
    return [status setContourKind:[sender selectedTag]];
}


- doSetPoints:sender
{
    return [status setContourPoints:[sender intValue]];
}


- doSetOrder:sender
{
    return [status setContourOrder:[sender intValue]];
}


- doSetKey:sender
{
    return [status setContourInKey:[sender state]];
}



// Shuts up the compiler about unused RCSId
- (const char *) rcsid
{
    return RCSId;
}



@end





@implementation ContourOptionsPanel (Private)

- _updatePanel
{
    [panel disableDisplay];

    /* 
     *  If the current status is not nil, update the values of all the 
     *  controls.
     */
    if (status) {

	[kindMatrix selectCellWithTag:[status contourKind]];
	[pointsField setIntValue:[status contourPoints]];
	[orderField setIntValue:[status contourOrder]];
	[keyButton setState:[status contourInKey]];

    }

    [kindMatrix setEnabled:status? YES: NO];
    [pointsField setEnabled:status? YES: NO];
    [orderField setEnabled:status? YES: NO];
    [keyButton setEnabled:status? YES: NO];

    [panel reenableDisplay];
    [panel display];

    return self;
}

@end
